package com.example.cloudstremrocketmqconsumer8802.consumer;

import com.alibaba.fastjson.JSON;
import com.example.cloudstremrocketmqconsumer8802.channal.CustomerBinder;
import lombok.extern.slf4j.Slf4j;
import org.springframework.cloud.stream.annotation.StreamListener;
import org.springframework.messaging.handler.annotation.Payload;
import org.springframework.stereotype.Component;

/**
 * @ClassName: TopicOneConsumer
 * @Description:
 * @Date 2024/03/05 15:41
 * @Author songshaoqiu
 **/
@Slf4j
@Component
public class TopicOneConsumer {

   final String tag1 = "TAG1";

    @StreamListener(value = CustomerBinder.topiceOne,condition = "headers['rocketmq_TAGS']=='" +tag1+ "'")
    public void consumerLive(@Payload String msg){
        log.info("通过stream收到消息，messageBody = {}", msg );
    }

    // @StreamListener(value = CustomerBinder.testTopic,condition = "headers['rocketmq_TAGS']=='" +"TAG1111"+ "'")
    // public void test(@Payload String msg){
    //     log.info("通过stream收到消息，messageBody = {}", msg );
    // }
}
